<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        div{
            width: 200px;
            height: 200px;
            background-color: red;
        }
    </style>
</head>
<body>
<div id="box">这是一个元素</div>
<script type="text/javascript">
    var box=document.getElementById("box");
   box.ondblclick=function(){
       console.log("事件");
   }
</script>

</body>
</html>